#include <iostream>
#include <cstring>
#include "gui.h"

void c_objeto_gui::atexto(char m)
{
 if(g_texto[0] == ' ')
  g_texto[0] = m;
 else
 {
  int longitud;
  longitud = strlen(g_texto);
  g_texto[longitud] = m;
  g_texto[longitud+1] = '\000';
 }
}

void c_objeto_gui::rtexto()
{
 unsigned int tam;
 tam = strlen(g_texto);
 if(tam > 1)
 {
  g_texto[tam-1] = '\000';
 }
 else
 {
  g_texto[0] = ' ';
 }
}

void c_objeto_gui::btexto()
{
 g_texto[0] = ' ';
 g_texto[1] = '\000';
}

c_gui_boton::c_gui_boton(unsigned int id,unsigned int x,unsigned int y,unsigned int i,char * t)
{
 g_id = id;
 g_img = i;
 g_x = x;
 g_y = y;
 g_texto = t;
 g_tipo = G_T_BOTON;
}

c_gui_texto::c_gui_texto(unsigned int id,unsigned int x,unsigned int y,unsigned int i,char * t)
{
 g_id = id;
 g_img = i;
 g_x = x;
 g_y = y;
 g_texto = new char[256];
 strcpy(g_texto,t);
 g_tipo = G_T_TEXTO;
}

c_gui_imagen::c_gui_imagen(unsigned int id,unsigned int x, unsigned int y,unsigned int i)
{
 g_id = id;
 g_x = x;
 g_y = y;
 g_img = i;
 g_tipo = G_T_IMAGEN;
}

c_gui_ctec::c_gui_ctec(unsigned int id,unsigned int x, unsigned int y, unsigned int tipo)
{
 g_id = id;
 g_x = x;
 g_y = y;
 g_b_nmensajes = tipo;
 g_tipo = G_T_CTEC;
}

c_gui_cuni::c_gui_cuni(unsigned int id,unsigned int x, unsigned int y, unsigned int tipo)
{
 g_id = id;
 g_x = x;
 g_y = y;
 g_b_nmensajes = tipo;
 g_tipo = G_T_CUNI;
}

c_gui_lmapas::c_gui_lmapas(unsigned int id, unsigned int x, unsigned int y)
{
 g_id = id;
 g_x = x;
 g_y = y;
 g_tipo = G_T_LMAPAS;
 g_img = 4;
 g_texto = new char[256];
 g_texto[0] = '\000';
}
